package com.cershy.linyuminiserver.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cershy.linyuminiserver.constant.DeviceType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.geo.Distance;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "device" ,autoResultMap = true)
public class Device {
    private static final long serialVersionUID = 1L;

    @TableId("id")
    private Integer id;

    @TableField("name")
    private String name;

    @TableField("type")
    private Integer type;

    @TableField(exist = false)
    private DeviceType deviceType;

    @TableField("x")
    private Double x;

    @TableField("y")
    private Double y;

    @TableField("is_imp")
    private Integer isImp;

    @TableField("device_code")
    private String deviceCode;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private Double distance;

    @TableField(exist = false)
    private Integer current;
}
